print('1.交集操作')
s1 = {10, 20, 30, 40}
s2 = {30, 40, 50, 60}
print(s1.intersection(s2))
print(s1  & s2)
print()

print('2.并集操作')
print(s1.union(s2))
print(s1 | s2)
print()

print('3.差集操作')
print(s1.difference(s2)) #等价于s1 - s2 print(s1 - s2)
print(s2.difference(s1))
print()

print('4.对称差集')
s1 = {10, 20, 30, 40}
s2 = {30, 40, 50, 60}
print(s1.symmetric_difference(s2))

print('5.数据的生成')
lst = [i * i for i in range(10)]
print(lst)
lst = {i * i for i in range(10)}
print(lst)